<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") />
<cfset mainQueries = CreateObject("component", "#session.rootDir#.cfc.queries") />
<cfset SCFAD = CreateObject("component", "code_lib.SCF_ActiveDirectory") />
<cfset util = CreateObject("component", "#session.rootDir#.cfc.utilities") />

<cfoutput>
<!---HTML header, css links, js links, and page title--->
#BASE.htmlTerminationHeader(
    "../js/Step3-ExecTermManually.js", <!---JS links--->
    "", <!---CSS links--->
    "Step 3: Manually Terminate Employee", <!---Page Title--->
    "Status" <!---Active Nav Link--->
)#
<!---HTML header, css links, js links, and page title--->

<cfif Session.bolAuth EQ True and (Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR)> 
    
    <cfset LOCALS = { } />
    
    <cfif isdefined("URL.TermReqID")>
        <cfset LOCALS.TermReqID = URL.TermReqID> 
    <cfelseif isdefined("Session.TermReqID")>
        <cfset LOCALS.TermReqID = Session.TermReqID> 
    <cfelse>
        <cfset LOCALS.TermReqID = 0> 
    </cfif>
    
    <cfif isdefined("Session.intUserRosettaID")>
        
        <cfset Termination = CreateObject("component", "#session.rootDir#.cfc.Termination").init(LOCALS.TermReqID, 1) />
        <cfset getAD = SCFAD.getUserAttributesByDN(Termination.UserDN) />
	    <cfset QUERIES = { GetEmpInfoByStep = mainQueries.funcGetEmpInfoTermination( Termination.GetTermDetails.ActionStepID ) } />

            
	    <h1 class="title">Step 3: Manually Term Employee Records</h1>                        
	    <div class="entry">
		    <p>
	            The termination of employee records has been initiated for 
	            <strong>#Termination.EmployeeObj.FullName#</strong>. 
	            Please wait while E-PAR terminates 
	            the following system records:
	        </p>
                                       
            <Cfform id="frmTermination" >
           
            <input type="hidden" id="RosettaID" value="#Termination.GetTermDetails.RosettaID#" />
            <input type="hidden" id="TermReqID" value="#LOCALS.TermReqID#" />

			<table>
			    <tr>
			        <td width='25'>&nbsp;</td>
			        <td>
			            <table cellpadding="2">
			                <tr>
			                    <td valign='absmiddle' nowrap="nowrap">Disable Network Account:</td>
			                    <td valign='absmiddle'>
									<cfif getAD.UserAccountControl eq 512 >
									    <cfinput type="button" name="AD" value="Go" />
									    <span id="AD" class="error"></span>&nbsp;<img id="AD" align="absmiddle" src="../images/blank.jpg" />
									<cfelse>
									    <span id="AD" class="message"><strong>Success</strong></span>&nbsp;
									    <img id="AD" align="absmiddle" src="../images/blank.jpg" />
									</cfif>		                                
			                    </td>
			                </tr>
			                <tr>
			                    <td valign='absmiddle' nowrap="nowrap">Archive Home Folder:</td>
			                    <td valign='absmiddle'>
									<cfif DirectoryExists(Termination.Home)>
									    <cfinput type="button" name="HomeFolder" value="Go" />
									    <span id="HomeFolder" class="error"></span>&nbsp;<img id="HomeFolder" align="absmiddle" src="../images/blank.jpg" />
									<cfelse>
									    <span id="HomeFolder" class="message"><strong>Success</strong></span>&nbsp;
									    <img id="HomeFolder" align="absmiddle" src="../images/blank.jpg" />
									</cfif>			                        
			                    </td>
			                </tr>
			                <tr>
			                    <td valign='absmiddle'>HR Employee Record:</td>
			                    <td valign='absmiddle'>
                                    <cfinput type="button" name="HR" value="Go" />
			                        <span id="HR" class="error"></span>&nbsp;<img id="HR" align="absmiddle" src="../images/blank.jpg" />    
			                    </td>
			                </tr>
			                <tr>
			                    <td valign='absmiddle' nowrap="nowrap">Disable TimeKeeper:</td>
			                    <td valign='absmiddle'>
			                        <cfinput type="button" name="TimeKeeper" value="Go" />
			                        <span id="TimeKeeper" class="error"></span>&nbsp;<img id="TimeKeeper" align="absmiddle" src="../images/blank.jpg" />
			                    </td>
			                </tr>
			                <tr>
			                    <td valign='absmiddle' nowrap="nowrap">Export Mailbox:</td>
			                    <td valign='absmiddle'>
                                    <cfif util.funcCheckEmailExport(Termination.RootArchiveDir, Termination.EmployeeObj.login).RecordCount GT 0 >
                                        <span id="ExportMail" class="message"><strong>Success</strong></span>&nbsp;
                                        <img id="ExportMail" align="absmiddle" src="../images/blank.jpg" />
                                    <cfelse>
                                        <cfinput type="button" name="ExportMail" value="Go" />
                                        <span id="ExportMail" class="error"></span>&nbsp;<img id="ExportMail" align="absmiddle" src="../images/blank.jpg" />
                                    </cfif>			                        
			                    </td>
			                </tr>
			                <tr>
			                    <td valign='absmiddle' nowrap="nowrap">Archive User Account:</td>
			                    <td valign='absmiddle'>
                                    <cfif util.funcCheckArchivedOU(Termination.EmployeeObj.FirstName, Termination.EmployeeObj.LastName) GT 0 >
                                       <span id="UserAccount" class="message"><strong>Success</strong></span>&nbsp;
                                        <img id="UserAccount" align="absmiddle" src="../images/blank.jpg" />
                                    <cfelse>
                                        <cfinput type="button" name="UserAccount" value="Go" />                                                                                
                                        <span id="UserAccount" class="error"></span>&nbsp;<img id="UserAccount" align="absmiddle" src="../images/blank.jpg" />
                                    </cfif>
			                    </td>
			                </tr>
			                <tr>
			                    <td valign='absmiddlep' nowrap="nowrap">Rosetta Stone Record:</td>
			                    <td valign='absmiddle'>
                                    <cfif util.funcCheckRosetta(Termination.GetTermDetails.RosettaID).RecordCount GT 0 >
                                        <span id="Rosetta" class="message"><strong>Success</strong></span>&nbsp;
                                        <img id="Rosetta" align="absmiddle" src="../images/blank.jpg" />
                                    <cfelse>
                                        <cfinput type="button" name="Rosetta" value="Go" />                                                                                
                                        <span id="Rosetta" class="error"></span>&nbsp;<img id="Rosetta" align="absmiddle" src="../images/blank.jpg" />
                                    </cfif>			                          
			                    </td>
			                </tr>
			                   <tr>
			                       <td valign='absmiddlep' nowrap="nowrap">Complete Termination:</td>
			                       <td valign='absmiddle'>
			                              <cfinput type="button" name="Complete" value="Go" />                                                                                
			                           <span id="Complete" class="error"></span>&nbsp;<img id="Complete" align="absmiddle" src="../images/blank.jpg" />  
			                       </td>
			                   </tr>
			            </table>                                    
			        </td>
			    </tr>
			    <tr>
			        <td width='25'>&nbsp;</td>
			    </tr>
			    <tr>
			        <td width='25'>&nbsp;</td>
			        <td>
			            <span id="Notice" class="error">During this time, please refrain from refreshing the page.</span>                              
			        </td>
			    </tr>
			</table>
            </cfform>

            
        <cfelse>
            Session Expired.  Click <a href="Status.cfm">here</a> to redirect to the Termination Status page.                            
        </cfif>
        
    </div>

<cfelse>
    <cfinclude template="../denied.cfm">
</cfif>


<!---HTML footer, closes html and body tags.  Any footer info goes here--->
#BASE.htmlTerminationFooter()#
<!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>